#!/usr/bin/env python
# -*-coding:utf-8 -*-
__author__ = 'whisky'
__date__ = '2019/1/18 12:09'

s = 'The months of learning in Old Boy education are the few months that I think the time efficient is the most.I had also studied at other training institutions before, but I was hard to understand what the tutor said and hard to follow. It was just too much to learn with no outline.'
word_dic = {}

ret = s.replace('.','').replace(',', '')
print ret
lst = ret.split(' ')
print lst
lst_to_set = set(lst)
for word in lst:
    if word in word_dic.keys():
        word_dic[word] += 1
    else:
        word_dic[word] = 1

print word_dic
ret1 = sorted(word_dic.items(),key=lambda x:x[1], reverse=True)
for k, v in ret1:
    if v < 2:
        continue
    print(k, v)

